StringG.refStringNewLen

Creates a new reference counted string and copies the contents of @str into it, up to @len bytes.

Since this function does not stop at nul bytes, it is the caller's responsibility to ensure that @str has at least @len addressable bytes.

class StringG
static
string
refStringNewLen
(
string str
,
ptrdiff_t len
)

Parameters

str string

a string

len ptrdiff_t

length of @str to use, or -1 if @str is nul-terminated

Return Value

Type: string

the newly created reference counted string

Meta

Since

2.58